import javax.swing.*;
import java.awt.*;

public class Main {
    public static void main(String[] args) {
        JFrame frame = new JFrame("匀速运动的小球");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        int width = 640;
        int height =480;
        int speed = 10;
        int startX = 320, startY = 240;
        int r = 20;
        frame.setSize(width+2*30, height+2*40);
        frame.setBackground(Color.yellow);
        Ball ball = new Ball(startX,startY,r,width,height,Direction.RIGHTDOWN,speed);
        RunBallAnimation animation = new RunBallAnimation(ball, width, height);
        frame.add(animation);
        frame.setVisible(true);
    }
}
